package com.zhuqi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author : ZhuQi
 * @version : 时间:2022/6/18 15:34 版本:
 * @description :
 */
@SpringBootApplication
public class OrderService {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(OrderService.class);
        while (true) {
            String property = applicationContext.getEnvironment().getProperty("wx.appId");
            System.out.println(property);
            if (property.equals("222")) {
                break;
            }
        }
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
